using System;
using System.Collections.Generic;
using System.Text;

namespace PocketLibrary.Image
{
    public class flickrPhoto
    {
        private string pSecret = "";
        private string pServer = "";
        private string pFarm = "";
        private string pId="0";

        public string Id
        {
            get { return pId; }
            set { pId = value; }
        }

        private string pTitle;

        public string Title
        {
            get { return pTitle; }
            set { pTitle = value; }
        }

        private string pThumbnailSize = "t";

        public string ThumbnailSize
        {
            get { return pThumbnailSize; }
            set { pThumbnailSize = value; }
        }


        public flickrPhoto(string id, string secret, string server, string farm,
            string title)
        {
            Id = id;
            Title = title;

            pServer = server;
            pFarm = farm;
            pSecret = secret;
        }

        public flickrPhoto()
        {

        }

        public string ThumbnailUrl
        {
            get
            {
                return string.Format(
                    "http://farm{0}.static.flickr.com/{1}/{2}_{3}_{4}.jpg",
                    pFarm, pServer, Id, pSecret, ThumbnailSize);
            }
        }

        public string LargeUrl
        {
            get
            {
                return string.Format(
                    "http://farm{0}.static.flickr.com/{1}/{2}_{3}.jpg",
                    pFarm, pServer, Id, pSecret);
            }
        }
    }
}
//<photo id="2484" secret="123456" server="1" title="my photo" isprimary="0" /> 
//http://farm{farm-id}.static.flickr.com/{server-id}/{id}_{secret}.jpg
//    or
//http://farm{farm-id}.static.flickr.com/{server-id}/{id}_{secret}_[mstb].jpg
//    or
//http://farm{farm-id}.static.flickr.com/{server-id}/{id}_{o-secret}_o.(jpg|gif|png)